package com.xf.spring.annotation;

import com.xf.spring.annotation.controller.UserController;
import com.xf.spring.annotation.repository.UserRepository;
import com.xf.spring.annotation.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by xiefei on 2015/12/29.
 */
public class Test {

    public static final void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("xmls/bean-annotation.xml");

//        TestObject testObject = (TestObject) context.getBean("testObject");
//        System.out.println(testObject);

        UserController userController = (UserController) context.getBean("userController");
        System.out.println(userController);
        userController.excuete();

//        UserService userService = (UserService) context.getBean("userService");
//        System.out.println(userService);
//
//        UserRepository userRepository = (UserRepository) context.getBean("userRepository");
//        System.out.println(userRepository);
    }
}
